﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls.Common="clr-namespace:Imagin.Controls.Common;assembly=Imagin.Controls.Common">
    <Style TargetType="{x:Type ToggleButton}">
        <Setter Property="Background" Value="{DynamicResource Brush.ToggleButton.Background}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.ToggleButton.Border}" />
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border 
                        x:Name="Border" 
                        Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}" 
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Padding="{TemplateBinding Padding}">
                        <ContentPresenter  
                            Content="{TemplateBinding Content}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource Brush.ToggleButton.MouseOver.Background}" />
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.ToggleButton.MouseOver.Border}" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter Property="Background" Value="{DynamicResource Brush.ToggleButton.Checked.Background}" />
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.ToggleButton.Checked.Border}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.6" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>